// eslint.config.cjs 或 .js
const vueParser = require('vue-eslint-parser');
const pluginVue = require('eslint-plugin-vue');
const globals = require('globals');
const prettier = require('eslint-plugin-prettier');
const skipFormatting = require('@vue/eslint-config-prettier/skip-formatting');


module.exports = [
	{
		files: ['**/*.{js,vue}'],
		ignores: ['dist/**', 'coverage/**'],
		languageOptions: {
			parser: vueParser, // 这里要传对象
			ecmaVersion: 2022,
			sourceType: 'module',
			globals: {
				...globals.browser
			}
		},
		plugins: {
			vue: pluginVue,
			prettier
		},
		rules: {
			'semi': ['error', 'always'],
			'prettier/prettier': 'error',
			'vue/multi-word-component-names': 'off',
			'vue/valid-define-props': 'off',
			'vue/no-v-model-argument': 'off',
			'prefer-rest-params': 'off',
		}
	},
	skipFormatting
];
